<?php
include_once("../config.php");
//$id=$_GET['id'];

$id=intval($_GET['id']);
$sql = "select status,xxzx from wenti where id=$id";
$requ = mysqli_query($con,$sql);
$rs=mysqli_fetch_array($requ);
if($rs['status']!=0&&$rs['status']!=11&&$rs['status']!=4){
	die('{"status":"0","msg":"此单已被其他管理员审核"}');
}







$sql = "select a.id as id,a.bm as bm,a.dz as dz,a.lxr as lxr,a.tel as tel,a.xm as xm,
		a.yysj as yysj,a.tbsj as tbsj,a.status as status,
		a.gz as gz,a.ms as ms,a.img as img,user.ming as bxr 
		from wenti as a 
		left join user on a.uid=user.openid 
		where a.id=$id";
$requ = mysqli_query($con,$sql);
$dsh='';//报修者提报，待管理员审批的订单
$rs=mysqli_fetch_array($requ);
	//ID，部门，地址，联系人，电话，维修项目，故障，描述，预约时间，报修时间，图片，报修人
	$dsh='{"id":"'.$rs['id'].'","bm":"'.$rs['bm'].'","dz":"'.$rs['dz'].'",
			"lxr":"'.$rs['lxr'].'","tel":"'.$rs['tel'].'","xm":"'.$rs['xm'].'",
			"gz":"'.$rs['gz'].'","ms":"'.$rs['ms'].'","yysj":"'.$rs['yysj'].'",
			"tbsj":"'.date("Y-m-d H:i:s",$rs['tbsj']).'","status":"'.$rs['status'].'",
			"img":"'.str_replace('"',"'",$rs['img']).'","bxr":"'.$rs['bxr'].'"}';









$result = '{"status":"1","msg":"ok","dsh":'.$dsh.'}';
echo $result;
